package com.bolt.convention.validation.constraints;

import com.bolt.convention.validation.validators.ChineseNameValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 中文姓名校验，允许间隔号
 */
@Documented
@Constraint(validatedBy = {ChineseNameValidator.class})
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface ChineseName {
    String message() default "{com.bolt.convention.validation.constraints.ChineseName.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
